<?php
$q= mysql_escape_string($_GET["search_name"]);
if (strlen($q) > 2)
{
    include "../Include/Config.php";
    $torrents_name = mysql_query("SELECT name FROM `torrents` WHERE `name` like '%".$q."%' ORDER BY `name`;") or die(mysql_error());
    while($data = mysql_fetch_array( $torrents_name ))
        $response .= ", <a href=\"/TorrentInfo&name=".$data['name']."\">".$data['name']."</a>\n";
    $response = substr($response, 2, strlen($response));
}
else
    $response="<b>Enter 3 or more characters</b>";
echo $response;
?>